package com.atmilan.quartz.mapper;

import org.apache.ibatis.annotations.Update;

import com.atmilan.quartz.model.entity.crmeb.StoreProduct;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * crmeb商品
 * @Description: 
 * @author daigb
 * @date 2021-01-08
 */
@DS("crmeb")
public interface StoreProductMapper extends BaseMapper<StoreProduct> {
    
    @Update("truncate table eb_store_product")
    void deleteAll();
    
//    @Update("UPDATE eb_store_product_attr_value SET stock = 0 WHERE product_id IN (SELECT id FROM eb_store_product WHERE is_europe = #{isEurope} AND update_flag = FALSE)")
    @Update("update eb_store_product_attr_value a, eb_store_product b set a.stock = 0 where a.product_id=b.id and b.is_europe = #{isEurope} and b.update_flag = FALSE")
    void downloadSku(Integer isEurope);

}
